from langfuse.openai import openai  # OpenAI integration
from langfuse.decorators import observe

# 加载 .env 到环境变量
from dotenv import load_dotenv, find_dotenv

_ = load_dotenv(find_dotenv())


# 定时langfuse的trace名称为firstDemo
@observe(name="firstDemo")
def run():
    return openai.chat.completions.create(
        model="gpt-3.5-turbo",
        messages=[
            {"role": "user", "content": "对我说Hello, World!"}
        ],
    )
print(run())
